package org.test;

import java.math.BigDecimal;
import java.sql.Connection;

import javax.sql.DataSource;

import org.apache.commons.dbutils.QueryRunner;

public class App2 {

	public static void main(String[] args) throws Exception {
		DataSource ds = DbPoolConnection.getInstance().getDataSource();
		Connection conn = ds.getConnection();
		conn.setAutoCommit(false);
		
		QueryRunner run = new QueryRunner(ds);
//		List<User> user = run.query("select * from user where id > ?",2, new BeanListHandler<User>(User.class));
//		System.out.println(user);
		run.update(conn,"insert into user(id,name,age,data)values(?,?,?,?)","8","zhangsan","12",new BigDecimal(10000));
		
		conn.commit();
		conn.close();
	}

}
